<template>
	<div class="validate_cont">
		<mt-field label="姓名" placeholder="请输入用户名" v-model="username" v-validate="'required'" name="姓名"></mt-field>
		<mt-field label="身份证号" placeholder="请输入身份证号" v-model="idcard" v-validate="'required|idCard'" name="身份证号"></mt-field>
		<mt-field label="银行卡号" placeholder="请输入银行卡号" v-model="bankcode" v-validate="'required|bankCode'" name="银行卡号"></mt-field>
		<mt-field label="预留手机号" placeholder="请输入预留手机号" v-model="phonenum" v-validate="'required|phone'" name="预留手机号"></mt-field>
		<div class="submit_btn" @click="doSubmit">提交</div>
	</div>


</template>


<script>
	import { Field,Toast } from 'mint-ui'
	export default{
		components:{
			Field,Toast
		},
		data(){
			return{
				username:'',
				idcard:'',
				bankcode:'',
				phonenum:''
			}
		},
		methods:{
			doSubmit(){
				this.$validator.validateAll().then((result) => {
					if (result) {
						Toast('提交成功!')
					}else{
						Toast(this.errors.items[0].msg);
					}
				})
			}
		}
	}


</script>

<style lang="scss" scoped>
    .mint-cell-wrapper{padding: 0;background-image:none;border-bottom: 1px solid #f4f4f4;}
	.submit_btn{height:40px;line-height:40px;text-align:center;background-color:#26a2ff; color: #fff;border-radius: 5px;margin-top: 10px;font-size: 16px;}
</style>